﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy1_5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // 设置窗体图标
            this.Icon = new Icon("icon.ico");
            // 设置背景图
            this.BackgroundImage = Image.FromFile("bg1.jpg");
            this.BackgroundImageLayout = ImageLayout.Stretch;
            // 隐藏标签
            lblHello.Visible = false;
        }

        private void Form1_Click(object sender, EventArgs e)
        {
            // 切换背景图
            this.BackgroundImage = Image.FromFile("bg2.jpg");
            // 隐藏标签
            lblHello.Visible = false;
        }

        private void Form1_DoubleClick(object sender, EventArgs e)
        {
            // 切换背景图（可换第三张，如bg3.jpg）
            this.BackgroundImage = Image.FromFile("bg3.jpg");
            // 显示标签
            lblHello.Visible = true;
        }
    }
}
